﻿namespace Spectral.Operations
{
    using System;

    // NOTE: The methods in this class are rewritten after compilation by Spectral.Operations.Rewriter.exe.
    internal static class Operator<T>
        where T : struct, IEquatable<T>, IComparable<T>
    {
        static Operator()
        {
            var type = typeof(T);

            // The hack only works on primitive types. Also... we don't want people adding bools and chars :P
            if (!type.IsPrimitive || type == typeof(bool) || type == typeof(char))
                throw new ArgumentException("The specified type is not supported by these operations.");
        }

        public static T Zero { get { return default(T); } }
        public static T One { get { return default(T); } }

        public static T Add(T left, T right) { return default(T); }
        public static T Subtract(T left, T right) { return default(T); }
        public static T Multiply(T left, T right) { return default(T); }
        public static T Divide(T left, T right) { return default(T); }
        public static T Remainder(T left, T right) { return default(T); }

        public static T Negate(T value) { return default(T); }

        public static T Sqrt(T value) { return default(T); }
        public static T Pow(T value, T power) { return default(T); }

        public static T Floor(T value) { return default(T); }
        public static T Ceiling(T value) { return default(T); }

        public static T Sin(T value) { return default(T); }
        public static T Cos(T value) { return default(T); }
    }
}
